package com.bungarus.client.busi;

import java.io.Serializable;

/**
 * Created by tang on 2018/12/26.
 */
public class EndUser implements Serializable {
    private long userId;
    private int tenantId;
    private String sessionId;
    private String token;

    public EndUser(String userId, int tenantId, String sessionId, String token) {
        this.userId = Long.parseLong(userId);
        this.tenantId = tenantId;
        this.sessionId = sessionId;
        this.token = token;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof EndUser)) return false;

        EndUser endUser = (EndUser) o;

        return getUserId() == endUser.getUserId();

    }

    @Override
    public int hashCode() {
        return (int) (getUserId() ^ (getUserId() >>> 32));
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getTenantId() {return  tenantId;}

    public void setTenantId(int tenantId) {
        this.tenantId = tenantId;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

}
